package cn.nfwx.tv.fragment.nyqf;

import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;

import cn.nfwx.tv.activity.HomeActivity;
import cn.nfwx.tv.base.BaseFragment;

public class MeFragment extends BaseFragment {

    public static MeFragment newInstance() {

        Bundle args = new Bundle();
        MeFragment fragment = new MeFragment();
        fragment.setArguments(args);
        return fragment;
    }


    @Override
    public View initView() {
        FrameLayout frameLayout = new FrameLayout(mContext);
        frameLayout.setBackgroundColor(Color.WHITE);
        return frameLayout;
    }

    @Override
    protected void bindView() {
        TextView textView = new TextView(mContext);
        textView.setText("返回观看直播");
        textView.setTextColor(Color.parseColor("#FF4040"));
        textView.setTextSize(20);
        textView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(mContext, HomeActivity.class);
                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                startActivity(intent);
                getActivity().finish();
            }
        });
        FrameLayout frameLayout = (FrameLayout) getView();
        frameLayout.addView(textView, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.CENTER));
    }
}
